<template>
	<uni-indexed-list :options="list" :show-select="true" @click="bindClick" />
</template>

<script>
	import fabricService from "@/api/auth/fabricService";
	export default {
		data() {
			return {
				list:  [{
					'data': []
				}],
				userList: []
			}
		},
		onLoad(query) {
			fabricService.workteamUserList().then(res => {
				this.userList = res;
				this.list[0].data = res.map(item => item.semployeename_cn);
			})
		},
		methods: {
			bindClick(e) {
				const data = [];
				e.select.forEach(item => {
					let t = this.userList.find(f => {
						return f.semployeename_cn === item.name
					})
					data.push(t);
				});
				uni.$emit('dataFromChild', data);
			}
		}
	}
</script>

<style>
</style>